<template>
  <div>
    <!-- 列表 -->
    <el-table :data="memberlist" border style="width: 100%">
      <el-table-column prop="uid" label="用户编号" width="180">
      </el-table-column>
      <el-table-column prop="nickname" label="昵称" width="180">
      </el-table-column>
      <el-table-column prop="phone" label="手机号" width="180">
      </el-table-column> 
      <el-table-column prop="status" label="状态">
        <template slot-scope="item">
          <div>
            {{ item.row.status == 1 ? "启用" : "禁用" }}
          </div>
        </template>
      </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="item">
          <div>
            <el-button
              @click="edit(item.row.uid)"
              plain
              type="primary"
              size="mini"
              >编辑</el-button
            >
          </div>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
//引入辅助性函数
import { mapGetters, mapActions } from "vuex";
//引入你封装好的接口

export default {
  mounted() {
    // this.getMember();
    this.getMemberList();
  },
  computed: {
    ...mapGetters({
      memberlist: "member/getMemberList",
    }),
  },
  methods: {
    ...mapActions({
      getMemberList: "member/getMemberAction",
    }),
    //点击编辑按钮事件
    edit(uid) {
      this.$emit("edit", uid);
    },
  },
};
</script>

<style>
</style>